package com.ming.rabbitmq.eight;

import com.ming.rabbitmq.util.RabbitMqUtils;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;

import java.util.Scanner;

public class Producer {
    public static final String NORMAL_EXCHANGE="normal_exchange2";

    public static void main(String[] args) throws Exception {

        Channel channel = RabbitMqUtils.getChannel();

        channel.exchangeDeclare(NORMAL_EXCHANGE, BuiltinExchangeType.DIRECT);
       /* AMQP.BasicProperties properties=new AMQP.BasicProperties()
                .builder()
                .expiration("10000")
                .build();*/
        for (int i = 0; i < 10; i++) {
            String message="info: "+i;
            channel.basicPublish(NORMAL_EXCHANGE, "zhangsan", null, message.getBytes());
        }

    }
}
